//package cn.flying.cloud.system.common.web;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import java.awt.image.BufferedImage;
//import java.io.IOException;
//
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import cn.flying.cloud.base.common.constants.Constants;
//import cn.flying.cloud.base.common.utils.lang.CaptchaUtil;
//
//
///**
// * @description: 获取验证码
// * @author: admin
// * @date: 2022年05月22日 17:58
// * @version: 1.0
// */
//@RestController
//@RequestMapping("/auth/")
//public class CaptchaController {
//
//    @RequestMapping("captcha")
//    public void captcha(HttpServletRequest request, HttpServletResponse response) throws IOException {
//        /*
//             1.生成验证码
//             2.把验证码上的文本存在session中
//             3.把验证码图片发送给客户端
//             */
//        CaptchaUtil captchaUtil = new CaptchaUtil();
//        BufferedImage image = captchaUtil.getImage();
//        request.getSession().setAttribute(Constants.AUTH_CODE, captchaUtil.getText());
//        captchaUtil.output(image, response.getOutputStream());
//    }
//}
